<?php
use \Entities;
use \Managers;

class RssController extends Zend_Controller_Action
{

    public function init() {
        
    }
    
    public function indexAction(){
        $this->_helper->layout->disableLayout();
        $url = 'http://habrahabr.ru/rss/';
        $count = 50;

        $feed = Zend_Feed_Reader::import($url);
            $rss = array();
            foreach ($feed as $key=>$entry) {
                $rss[$key]['title'] = $entry->getTitle();
                $rss[$key]['description'] = $entry->getDescription();
                $rss[$key]['link'] = $entry->getLink();
                $rss[$key]['date'] = $entry->getDateCreated();
                $rss[$key]['site'] = $url;
            }

            $rssManager = new \Managers\Rss();
            $rssManager->clear();
            $rssManager->addRss($rss);

    }


}

